Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _total suffix to prometheus counters #2288

Closed
wants to merge 1 commit into from

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented Sep 1, 2023

Fixes #2287

Changes

Append _total suffix to Prometheus counters. This is done by:

  • Determine type of a metric based on the first data point. This assumes all data points within a metric translated have the same type.
  • Trim _total suffixes from counter metric names before appending the unit (_total must come after the unit suffix).
  • Add _total suffix to counters after the unit suffix.

@dashpole dashpole force-pushed the counter_total_suffix branch 2 times, most recently from bc16feb to 35d03b3 Compare September 1, 2023 17:58
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #2288 (a64dec8) into main (f52ec6c) will not change coverage.
The diff coverage is n/a.

❗ Current head a64dec8 differs from pull request most recent head ed46cdd. Consider uploading reports for the commit ed46cdd to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2288   +/-   ##
=======================================
  Coverage   87.52%   87.52%           
=======================================
  Files         199      199           
  Lines        5981     5981           
=======================================
  Hits         5234     5234           
  Misses        747      747           

@dashpole dashpole force-pushed the counter_total_suffix branch 4 times, most recently from e25e527 to a64dec8 Compare September 1, 2023 18:26
@dashpole dashpole force-pushed the counter_total_suffix branch from a64dec8 to ed46cdd Compare September 1, 2023 18:27
@dashpole
Copy link
Contributor Author

dashpole commented Sep 1, 2023

Duplicate of #2213

@dashpole dashpole closed this Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus exporter does not add _total suffixes to counters
2 participants